import axios from 'axios';

export default class{


    //获取预算编号
    getMaxCode(){
        return axios.get(`http://localhost/budgets/code`)
    }

    //批量添加直接成本预算
    addLaborSubcontract(subcontracts,tenderPurchaseDetails){
        var a = {}
        a.subcontracts=subcontracts
        a.tenderPurchaseDetails=tenderPurchaseDetails
        return axios.post(`http://localhost/budgets`,a)
    }

    //批量添加直接成本预算
    addLaborSubcontract1(subcontracts,tenderPurchaseDetails){
        var a = {}
        a.subcontracts=subcontracts
        a.tenderPurchaseDetails=tenderPurchaseDetails
        return axios.post(`http://localhost/budgets/aa`,a)
    }

    //查询所有直接成本预算
    getDirectlyData(getdir){
        return axios.get(`http://localhost/budgets`,{
            params:getdir
        })
    }

    //查询所有直接成本预算
    getDirectlyData1(getdir){
        return axios.get(`http://localhost/budgets/aa`,{
            params:getdir
        })
    }

    //查询所有直接明细
    getDierctly(){
        return axios.get(`http://localhost/budgets/directly`)
    }

    //查询所有间接明细
    getIndirect(){
        return axios.get(`http://localhost/budgets/indirect`)
    }

    //删除
    deleteByIdSubcontract(i){
        return axios.delete(`http://localhost/budgets/${i}`)
    }

    //删除
    deleteByIdSubcontract1(i){
        return axios.delete(`http://localhost/budgets/aa/${i}`)
    }

    //根据id查询
    getByIdDirectly(id){
        return axios.get(`http://localhost/budgets/${id}`)
    }

    //根据id查询
    getByIdDirectly1(id){
        return axios.get(`http://localhost/budgets/cc/${id}`)
    }

    //修改
    updateSubcontract(a){
        return axios.put(`http://localhost/budgets`,a)
    }

    //修改
    updateSubcontract1(a){
        return axios.put(`http://localhost/budgets/aa`,a)
    }
   
}